<?php if (!defined('THINK_PATH')) exit();?><!-- 加载头文件 -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/common.css" />
<?php if(($k == 'Index') AND ($f == 'index') ): ?><link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/index.css" />
	<?php elseif(($k == 'Detail') AND ($f == 'goodsdetail')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/goods_detail.css" />
	<?php elseif(($k == 'Shopcar') AND ($f == 'cart')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/cart.css" />
	<?php elseif(($k == 'Sureorder') AND ($f == 'sureorder')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/ensure_order.css" />
	<?php elseif(($k == 'Sureaddress') AND ($f == 'sureaddress')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/ensure_address.css"> 
	<?php elseif(($k == 'Submitpay') AND ($f == 'nowpay')): ?>
        <link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/now_pay.css">
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/cart.css" />
	<?php elseif(($k == 'Gerencenter') AND ($f == 'userpro')): ?>
        <link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/user_person_center.css">
	<?php elseif(($k == 'Myorder') AND ($f == 'userorder')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/user_center.css">
	<?php elseif(($k == 'Gerencenter') AND ($f == 'usercenter')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/user_center.css">
	<?php elseif(($k == 'Order') AND ($f == 'myorder')): ?>
		<link rel="stylesheet" type="text/css" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/css/order.css"><?php endif; ?>


</head>
<body>
<div class="container">
    <div class="top">
        <div class="topContent">
            <div class="topUserFunction">
				<?php if($_SESSION['name'] != ''): ?><p style="color:red">欢迎登陆!<?php echo ($_SESSION["name"]); ?></a><p>|</p><a href="<?php echo U('Public/loginout');?>">退出</p>
				<?php else: ?> 
				<p>请先</p><a href="<?php echo U('Public/login');?>">登陆</a><p>|</p><a href="<?php echo U('Public/register');?>">注册</a><?php endif; ?>
               
            </div>
            <div class="topFunction">
                 <a href="<?php echo U('index/index');?>">首页</a><a href="<?php echo U('Gerencenter/userpro');?>">我的中心</a><a href="<?php echo U('Myorder/userorder');?>">我的订单</a><a href="<?php echo U('Shopcar/cart');?>">我的购物车</a><a href="#">服务中心</a>
            </div>
        </div>
    </div>




    <div class="header">
        <div class="headerContent">
            <div class="headerLeft">
                <img src="/git/thinkphpkxs/thinkphpkxs01/Public/children/images/logo.jpg" width="200" height="95" />
                <div class="navButton">
                    <a>全部商品分类</a>
                </div>
                <div class="secondMenu">
                    <ul>
					
					<!-- 无限极分类输出 -->
					<?php if(is_array($wuxiantotal)): foreach($wuxiantotal as $k=>$vo): ?><li>
                            <a href="#" class="secondOption"><?php echo ($k); ?></a>
                            <div class="threeMenu">
                                <?php if(is_array($vo)): foreach($vo as $k1=>$vo1): ?><div class="threeMenuTitle">
										<p><?php echo ($k1); ?></p>
									   
									</div>
									<ul>
										 <?php if(is_array($vo1)): foreach($vo1 as $k2=>$vo2): ?><li><a href="#"><?php echo ($vo2["name"]); ?></a></li><?php endforeach; endif; ?>
									</ul><?php endforeach; endif; ?>
                            </div>
                        </li><?php endforeach; endif; ?>
						
                    </ul>
                </div>
            </div>
            <div class="headerMiddle">
                <div class="headerResouch">
                    <form action="#" method="post">
                    <input type="text" style=" width:350px; float:left; background-color:#FFF; height:36px; border:none; margin-top:6px; margin-left:10px;"  name="resouchText"/>
                    <input type="submit" style=" float:left; width:80px; margin-top:6px; background-color:transparent; color:#FFF; height:36px; font:18px yahei; border:none;" name="submit" value="搜索">
                    </form>
                </div>
                <div class="headerResouchBottom">
                    <ul>
                        <li ><a href="#" style="color:#f5b6bb;">迪士尼</a></li>
                        <li><a href="#">好孩子</a></li>
                        <li><a href="#">耐克</a></li>
                        <li><a href="#">啪啪尼克</a></li>
                        <li><a href="#">兔子小克</a></li>
                        <li><a href="#">南极人</a></li>
                        <li><a href="#">巴布豆</a></li>
                    </ul>
                </div>
				<!-- 输出导航栏 -->
                <div class="headerNav">
                    <ul>
					
					<?php if(is_array($info)): foreach($info as $k=>$vo): if($vo["status"] == 1 ): ?><li><a href="<?php echo ($vo["url"]); ?>"><?php echo ($vo["name"]); ?></a></li><?php endif; endforeach; endif; ?>
                     
                        
                    </ul>
                </div> 
            </div>
            <div class="headerRight"><a href="#"><img src="/git/thinkphpkxs/thinkphpkxs01/Public/children/images/erweima.jpg" width="101" height="100"></a><a href="#">扫一扫 加收藏</a></div>   
        </div>
    </div>

     <div class="headerContent">
            <div class="pageName">
                <p>确认地址</p>
            </div>
            <div class="headerStepRight">
                <img src="/git/thinkphpkxs/thinkphpkxs01/Public/children/images/title3.png">
                <ul>
                    <li><a class="overstep" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/#">我的购物车</a></li>
                    <li><a class="overstep" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/#">确定订单</a></li>
                    <li><a class="overstep" href="/git/thinkphpkxs/thinkphpkxs01/Public/children/#">确定地址</a></li>
                    <li><a href="/git/thinkphpkxs/thinkphpkxs01/Public/children/#">确定提交</a></li>
                </ul>
            </div>
        </div>
    
    <div class="main">
		
		
	</div>
    
    
 <!-- 加载尾文件 -->

<div class="footer">
        <div class="footerTop">
            
            <div class="footerTopContent">
                <div id="toTop"></div>
                <div class="footerPromis">
                    <div class="footerPromisLeft">
                        <a>优</a>
                    </div>
                    <div class="footerPromisRight">
                        <p>优良品质</p>
                        <p>质量保证</p>
                    </div>
                </div>
                
                <div class="footerPromis">
                    <div class="footerPromisLeft">
                        <a>多</a>
                    </div>
                    <div class="footerPromisRight">
                        <p>类型多样</p>
                        <p>轻松购物</p>
                    </div>
                </div>
                
                <div class="footerPromis">
                    <div class="footerPromisLeft">
                        <a>好</a>
                    </div>
                    <div class="footerPromisRight">
                        <p>直仓发货</p>
                        <p>快速配送</p>
                    </div>
                </div>
                
                <div class="footerPromis">
                    <div class="footerPromisLeft">
                        <a>快</a>
                    </div>
                    <div class="footerPromisRight">
                        <p>正品行货</p>
                        <p>温馨服务</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="footerMiddel">
            <div class="footerMiddelContent">
                <div class="footerMiddelNav">
                    <div class="footerMiddelNavTitle"><p>新手上路</p></div>
                    <ul>
                        <li><a href="#">常见问题</a></li>
                        <li><a href="#">免费注册</a></li>
                        <li><a href="#">购物流程</a></li>
                        <li><a href="#">售后规则</a></li>
                    </ul>
                </div>
                <div class="footerMiddelNav">
                    <div class="footerMiddelNavTitle"><p>购物常识</p></div>
                    <ul>
                        <li><a href="#">常用尺寸</a></li>
                        <li><a href="#">货图差异</a></li>
                        <li><a href="#">购物流程</a></li>
                        <li><a href="#">购物规则</a></li>
                    </ul>
                </div>
                <div class="footerMiddelNav">
                    <div class="footerMiddelNavTitle"><p>服务保证</p></div>
                    <ul>
                        <li><a href="#">常见问题</a></li>
                        <li><a href="#">免费注册</a></li>
                        <li><a href="#">购物流程</a></li>
                        <li><a href="#">售后规则</a></li>
                        <li><a href="#">购物流程</a></li>
                        <li><a href="#">售后规则</a></li>
                    </ul>
                </div>
                <div class="footerMiddelNav">
                    <div class="footerMiddelNavTitle"><p>会员中心</p></div>
                    <ul>
                        <li><a href="#">会员管理</a></li>
                        <li><a href="#">关于会员</a></li>
                        <li><a href="#">我的收藏</a></li>
                        <li><a href="#">我的订单</a></li>
                        <li><a href="#">会员续费</a></li>
                        <li><a href="#">会员消息</a></li>
                    </ul>
                </div>
                <div class="footerMiddelNav">
                    <div class="footerMiddelNavTitle"><p>招商加盟</p></div>
                    <ul>
                        <li><a href="#">加盟管理</a></li>
                        <li><a href="#">关于加盟</a></li>
                        <li><a href="#">加盟详情</a></li>
                        <li><a href="#">联系客服</a></li>
                    </ul>
                </div>
                <div class="footerMiddelNavTwoDimensionCode">
                    <img src="/git/thinkphpkxs/thinkphpkxs01/Public/children/images/erweima.jpg"/>
                    <p>扫一扫 二维码</p>
                </div>
            </div>
        </div>
        <div class="footerButtom">
            <div class="footerButtomContent">
                <ul class="footerButtomNav">
                    <li><a href="<?php echo U('index/index');?>">返回首页</a><a>|</a></li>
                    <li><a href="#">关于我们</a><a>|</a></li>
                    <li><a href="#">会员中心</a><a>|</a></li>
                    <li><a href="#">购物常识</a><a>|</a></li>
                    <li><a href="#">客服中心</a><a>|</a></li>
                    <li><a href="#">招商加盟</a></li>
                </ul>
                <p>◎2003-2015 Taobao.com 版权所有</p>
                <p>网络文化经营许可证：浙网文[2013]0268-027号|互联网违法和不良信息举报电话:0571-81683755 blxx@list.alibaba-inc.com</p>
            </div>
        </div>
    </div>


<script src="/git/thinkphpkxs/thinkphpkxs01/Public/children/js/jquery-1.8.3.min.js"></script>

<script type="text/javascript">
	
	$(function(){
		dianji();
	
		function shujuall(){
		
			$.post("http://localhost/git/thinkphpkxs/thinkphpkxs01/index.php/Home/Sureaddress/addresslist", { "func": "getNameAndTime" },function(data){
		
				var str = ''
				for(var i=0;i<data.length;i++){
					str += '<div class="maincontent2"><div class="maincontenttop"><div class="maincontenttopleft"><a href="#">地址详情</a></div></div><div class="maincontentbottom"><div class="maincontentleft"><div>收货人：</div><div>所在地区：</div><div>地址：</div><div>手机：</div><div>固定电话：</div><div>电子邮箱：</div></div><div class="maincontentright">'
					 str += "<div class='consignee'>"+data[i].shouhuoren+"</div>"
					 str += "<div class='location'>"+data[i].address+"</div>"
					 str += "<div class='address'>"+data[i].detailaddress+"</div>"
					 str += "<div class='phonenumber'>"+data[i].phone+"</div>"
					 str += "<div class='Fixedtelephone'>"+data[i].tel+"</div>"
					 if(data[i].status==1){
						str += "<div class='maincontentrightbottom'><span class='email'>"+data[i].email+"</span><span class='editor' style='cursor:pointer'>编辑</span><span style='cursor:pointer' class='default selectedA' >设为默认</span>"
					 }else{
						str += "<div class='maincontentrightbottom'><span class='email'>"+data[i].email+"</span><span class='editor' style='cursor:pointer'>编辑</span><span style='cursor:pointer' class='default' >设为默认</span>"
					 }
					 str += "<input type='hidden' class='idcard' name='id' value='"+data[i].id+"'/><input type='hidden' class='stu' name='status' value='"+data[i].status+"'/><input type='hidden' class='idcard' name='id' value='"+data[i].p_id+"'/>"
					 str += "</div></div></div></div>"
				}
				str +='<div class="maincontent4"><a href="<?php echo U('Sureorder/Sureorder');?>">上一步</a>&nbsp;<a href="<?php echo U('Submitpay/nowpay');?>">下一步</a></div>'
				
				$(".main").html(str);
				
				$(".default").each(function(){
				
					var obj = $(this);
					
					obj.click(function(){
						var id = $(this).next().val();
						var status = $(this).next().next().val();
						var p_id = $(this).next().next().next().val();
						var url = "<?php echo U('Sureaddress/changeAddress');?>";
						$.ajax({
							  type: "POST",
							  url: url,
							  data: "id="+id+"&status="+status+"&p_id="+p_id,
							  success: function(msg){
							  //console.log(msg);
								
							  shujuall();
							  
							 //alert( "Data Saved: " + msg );
						   }
						});
					})
					
				
				})
				
			}, "json");
		
		}
	
		function dianji(){
			
			$.post("http://localhost/git/thinkphpkxs/thinkphpkxs01/index.php/Home/Sureaddress/addresslist", { "func": "getNameAndTime" },function(data){
		
			
				var str = ''
				for(var i=0;i<data.length;i++){
					str += '<div class="maincontent2"><div class="maincontenttop"><div class="maincontenttopleft"><a href="#">地址详情</a></div></div><div class="maincontentbottom"><div class="maincontentleft"><div>收货人：</div><div>所在地区：</div><div>地址：</div><div>手机：</div><div>固定电话：</div><div>电子邮箱：</div></div><div class="maincontentright">'
					 str += "<div class='consignee'>"+data[i].shouhuoren+"</div>"
					 str += "<div class='location'>"+data[i].address+"</div>"
					 str += "<div class='address'>"+data[i].detailaddress+"</div>"
					 str += "<div class='phonenumber'>"+data[i].phone+"</div>"
					 str += "<div class='Fixedtelephone'>"+data[i].tel+"</div>"
					 
					 if(data[i].status==1){
						str += "<div class='maincontentrightbottom'><span class='email'>"+data[i].email+"</span><span class='editor' style='cursor:pointer'>编辑</span><span style='cursor:pointer' class='default selectedA' >设为默认</span>"
					 }else{
						str += "<div class='maincontentrightbottom'><span class='email'>"+data[i].email+"</span><span class='editor' style='cursor:pointer'>编辑</span><span style='cursor:pointer' class='default' >设为默认</span>"
					 }
					
					 str += "<input type='hidden' class='idcard' name='id' value='"+data[i].id+"'/><input type='hidden' class='stu' name='status' value='"+data[i].status+"'/><input type='hidden' class='idcard' name='id' value='"+data[i].p_id+"'/>"
					 str += "</div></div></div></div>"
				}
				str +='<div class="maincontent4"><a href="<?php echo U('Sureorder/Sureorder');?>">上一步</a>&nbsp;<a href="<?php echo U('Submitpay/nowpay');?>">下一步</a></div>'
				
				$(".main").html(str);
				
				$(".default").each(function(){
				
					var obj = $(this);
					
					obj.click(function(){
						var id = $(this).next().val();
						var status = $(this).next().next().val();
						var p_id = $(this).next().next().next().val();
						var url = "<?php echo U('Sureaddress/changeAddress');?>";
						$.ajax({
							  type: "POST",
							  url: url,
							  data: "id="+id+"&status="+status+"&p_id="+p_id,
							  success: function(msg){
							  //console.log(msg);
								
							  shujuall();
							  
							 //alert( "Data Saved: " + msg );
						   }
						});
					})
					
				
				})
				
				
			}, "json");
			
		}

	})
		
	
</script>

</div>
</body>

<script src="/git/thinkphpkxs/thinkphpkxs01/Public/children/js/common.js"></script>
</html>